package web.servlet;

import jdbc.domain.Account;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import java.io.IOException;

public class NewOrderFormServlet extends HttpServlet {
    private static final String FORM="/WEB-INF/page/order/newOrder.jsp";
    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        HttpSession session=req.getSession();
        Account account =(Account)session.getAttribute("user");
    if(account ==null){
        resp.sendRedirect("signonForm");
    }
    else req.getRequestDispatcher(FORM).forward(req, resp);

    }
}
